//用户详细信息
const noticeInfo = require('../mongo/noticeInfo.js')
var connect = {
	find: function (data, callback) {
		noticeInfo.find(data, { _id: 0 }, function (err, datas) {
			callback(datas)
		})
	},
	add: function (data, callback) {
		new noticeInfo(data).save(function (err, datas) {
			if (!err) callback(1)
			else {
				console.log(err)
			}
		})
	},
	// 修改
	update: function (factor, data, ergodic, callback) {
		noticeInfo.updateOne(factor, data, ergodic, function (err, res) {
			if (!err) return callback(1)
			else {
				callback(0)
			}
		})
	},
	// 删除
	delete: function (data, callback) {
		noticeInfo.deleteMany(data, function (err, data) {
			if (!err) {
				return callback(1)
			} else {
				return callback(0)
			}
		})
	}
}
module.exports = connect
